#ifndef __OSAL_H__
#define __OSAL_H__

#define OSL_type FreeRTOS
#define useRTOS(x) (x==OSL_type)

#if useRTOS(FreeRTOS)
#include "FreeRTOS.h"
#include "task.h"
#endif

#ifdef INC_FREERTOS_H
#define configSTACK_DEPTH_TYPE uint16_t

#define OS_ENTER_CRITICAL() taskENTER_CRITICAL()
#define OS_EXIT_CRITICAL() taskEXIT_CRITICAL()

#define OS_Thread_Create(pxTaskCode,pcName,usStackDepth,pvParameters,uxPriority,pxCreatedTask) \
xTaskCreate((TaskFunction_t) pxTaskCode, \
			(char *) pcName,  \
			(configSTACK_DEPTH_TYPE) usStackDepth, \
			(void *) pvParameters, \
			(UBaseType_t) uxPriority, \
			(TaskHandle_t *) pxCreatedTask )

#define OS_Thread_Delete(pxDeleteTask) \
vTaskDelete((TaskHandle_t *) pxDeleteTask)
			
#define OS_Thread_StartScheduler(pxDeleteTask) \
vTaskStartScheduler()
			
#define OS_LOG_LIST(pcWriteBuffer)\
vTaskList(pcWriteBuffer)

#endif
			


#endif //__OSAL_H__
